from django.db import models

# Create your models here.

class StudentInfo(models.Model):
    username = models.CharField(verbose_name='姓名', max_length=16)
    age = models.CharField(verbose_name='年龄', max_length=16)
    address = models.CharField(verbose_name='地址', max_length=64)
    hobby = models.CharField(verbose_name='爱好', max_length=300)
    grade = models.CharField(verbose_name='成绩', max_length=16)

    def __str__(self):
        return f'姓名:{self.username}, 年龄:{self.age},' \
            f'地址:{self.address}, 爱好:{self.hobby}, 成绩:{self.grade}'
    class Meta:
        db_table = 'info'
